import { objDeepCopy,getDateString } from "@/assets/js/common.js";

let Controller = {
	created() {
		this.init();
	},
	mounted() {
		
	},
	methods: {
		init() {
			
		},
		//新建调拨单
		newPage(){
			this.$router.push({
				path:'listAllocationNew',
				query:{
					
				}
			});
		},
		//详情
		toDetial() {
			this.$router.push({
				path:'listAllocationDetail',
				query:{
					
				}
			});
		},
		//作废
		orderObsolete(row) {
			/* var mainTableData = this.Model.mainTableData;
			var idData = this.Model.idData;
			var idx = mainTableData.indexOf(row); */
			this.$confirm('作废该入库单后，则无法再对该单进行操作，是否确定作废?', '提示', {
			  confirmButtonText: '确定',
			  cancelButtonText: '取消',
			}).then(() => {
				/* mainTableData.splice(idx, 1);
				idData.splice(idx, 1); */
				this.$message({
					type: 'success',
					message: '删除成功!'
				});
			}).catch(() => {
			           
			});
		},
		selectedHighlight(data) {
			// 如果选中则添加高亮样式
			if (this.Model.TableSelectData.indexOf(data.row) > -1) {
				return {
					"background-color": "#FEF6EE"
				};
				return {}
			}
		},
		warehousing(row) {
			this.Model.warehousingDialogStatus = row.status;
			this.Model.warehousingDialogFlag = true;
		},
		handleSelectionChange(val) {
			console.log(val);
			this.Model.addGiftsSelectData = val
		},
		handleCurrentChange(val) {
			this.Model.pager.params.pageIndex = val;
		},
		handleSizeChange(val) {
			this.Model.pager.params.pageSize = val;
		},
		cardClick(color) {
			this.Model.cardSelected = color;
		},
		showChild(val) {
			this.Model.searchFromData = val;
		},
		toSearch(val) {
			console.log(val)
		},
		toClear(val) {
			this.Model.searchFromData = this.Model.defaultSearchFromData;
		},
		toExport(val) {
		  console.log(val);
		},
		onTabChange(val) {
			console.log(val, this.Model.activeTab)
			switch (val) {
				case 1:
					break;
				case 2:
					break;
				case 3:
					break;
			}
		},
		tips(that, type, message) {
			let duration;
			type == 'success' ? duration = 3000 : duration = 10000;
			that.$message({
				message: message,
				type: type,
				duration: duration
			});
		},
	},
	watch:{
		$route:{
		　　　handler(newValue, oldValue) {
				
		　　　},
		　　　deep: true
		},
  	
	},
	filters:{
		objFilters:function(value){
			
		}
	}
}
export default Controller;
